package com.coder.bike.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

@Getter
@Setter
@Accessors(chain = true)
@TableName("busi_maintain")
@ApiModel(value = "Maintain对象", description = "共享单车维护记录")
public class Maintain implements Serializable {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty("维护ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty("单车ID")
    private String bikeId;

    @ApiModelProperty("单车编号")
    @TableField(exist = false)
    private String bikeNum;

    @ApiModelProperty("维护类型：1-常规保养 2-故障维修 3-电池更换")
    private Byte maintainType;

    @ApiModelProperty("开始时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime startTime;

    @ApiModelProperty("完成时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime endTime;

    @ApiModelProperty("维护地点")
    private String location;

    @ApiModelProperty("详细地址")
    private String address;

    @ApiModelProperty("维修人员ID")
    private Long workerId;

    @ApiModelProperty("维护项目")
    private String items;

    @ApiModelProperty("费用")
    private BigDecimal cost;

    @ApiModelProperty("状态：0-待处理 1-进行中 2-已完成 3-已取消")
    private Byte status;

    @ApiModelProperty("现场照片（OSS路径数组）")
    private String images;

    @ApiModelProperty("逻辑删除")
    @TableLogic
    private Boolean deleted;

    @ApiModelProperty("更新时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    // 以下为查询条件字段
    @TableField(exist = false)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime lowStartTime;

    @TableField(exist = false)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime highStartTime;

    @TableField(exist = false)
    private BigDecimal lowCost;

    @TableField(exist = false)
    private BigDecimal highCost;
}